import java.sql.SQLOutput;
import java.util.Arrays;

public class Practice {
    public static void main(String[] args) {
        int[] arr = {1,2,3,4,7,96,7,8,8,9,9};
        System.out.println(is_Odd(arr));

    }
    public static boolean is_Odd(int[] arr) {
        int count = 0;
        for (int i = 0; i < arr.length ;) {
            if(arr[i] % 2 == 1) {
                count++;
                i++;
            }else{
                i += 1;
                count = 0;
            }
            if(count == 3){
                return true;
            }
        }
        return false;
    }

    public static int count(int[] arr,int i) {
        return 1;
    }
    public static int find(int[] arr) {

        return 1;
    }
    public static void main19(String[] args) {
        int[] arr = {1,2,3,4,5,5,5,5,5,5,5,5};
        int ret = find(arr);
        System.out.println(find(arr));
    }

    public static int findSingle(int[] arr) {
        bubbleSort(arr);
        int i = 0;
        for (i = 0; i < arr.length - 1; i+=2) {
            if(arr[i] == arr [i+1]){

            }else{
                return arr[i];
            }
        }
        return arr[i];

    }
    public static void main8(String[] args) {
        int[] arr = {1,1,2,2,3,9,3,4,4,5,5};
        int i = findSingle(arr);
        System.out.println(i);
    }
    public static int[] sum(int[] nums,int target) {
        int[] tag = new int[2];
        for (int i = 0; i < nums.length - 1; i++) {
            for(int j = i + 1; j < nums.length; j++) {
                if((nums[i] + nums[j]) == target) {
                    tag[0] = i;
                    tag[1] = j;
                    return tag;
                }
            }

        }
        tag[0] = -1;
        tag[1] = -1;
        return tag;
    }

    public static void main7(String[] args) {
        int[] nums = {1,2,4,2,5,7,3,2,5,2};
        int target = 12;
        System.out.println(Arrays.toString(sum(nums, target)));
    }
    public static void bubbleSort(int[] arr) {
        int flag = 0;
        //已经有序
        for (int i = 0; i < arr.length-1; i++) {
            for (int j = 0; j < arr.length - i- 1; j++) {
                if(arr[j] > arr[j+1]) {
                    int tmp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = tmp;
                    flag = 1;
                }
            }
            if(flag == 0) {
                break;
            }
        }
    }

    public static void main5(String[] args) {
        int[] arr = {3,5,2,6,8,2,7,3,67,23};
        System.out.println(Arrays.toString(arr));
        bubbleSort(arr);
        System.out.println("------------------");
        System.out.println(Arrays.toString(arr));
    }

    public static int binarySearch(int[] arr,int key) {
        int left = 0;
        int right = arr.length - 1;
        int mid = (left + right) / 2;
        while(left <= right) {
            if(arr[mid] > key) {
                right = mid - 1;
            } else if(arr[mid] < key) {
                left = mid + 1;
            }else{
                return mid;
            }
            mid = (left + right)/2;
        }
        return -1;
    }
    public static void main4(String[] args) {
        int[] arr = {1,2,3,4,5,6,7,8,9};
        int i = binarySearch(arr,2);
        System.out.println(i);

    }



    public static void reverse(int[] arr) {
        int left = 0;
        int right = arr.length - 1;
        int tmp = 0;
        while(left < right) {
            while(arr[left] % 2 == 1 && left < arr.length ) {
                left++;
            }
            while(arr[right] % 2 == 0 && right >= 0) {
                right--;
            }
            if(left < right){
                tmp = arr[left];
                arr[left] = arr[right];
                arr[right] = tmp;
            }


        }
    }

    public static void main3(String[] args) {
        int[] arr = {13,3,5,754,114,13,453,35};
        int[] arr1 = {1,9,3,4,6,8,6};
        System.out.println(Arrays.toString(arr));
        reverse(arr);
        System.out.println("__________________");
        System.out.println(Arrays.toString(arr));

        System.out.println(Arrays.toString(arr1));
        reverse(arr1);
        System.out.println("__________________");
        System.out.println(Arrays.toString(arr1));


    }
    public static void tramsform(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            arr[i] = arr[i] * 2;
        }
    }

    public static void main1(String[] args) {
        int[] arr = new int[]{1,2,3,4};
        System.out.println(Arrays.toString(arr));
        tramsform(arr);
        System.out.println(Arrays.toString(arr));


    }
}
